Skip to content

feat: support bolt+routing#391

Merged
mattkjames7 merged 9 commits into
mainfrom
bolt-routing
Jul 22, 2026
Merged

feat: support bolt+routing#391
mattkjames7 merged 9 commits into
mainfrom
bolt-routing

Conversation

@mattkjames7

@mattkjames7 mattkjames7 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Expose bolt+routing support for Memgraph HA provided by pymgclient in memgraph/pymgclient#86 and released in pymgclient==1.6.0.

  • Updated the MemgraphConnection class to create a routed connection.
  • Added a cached router and managed transactions using execute_read() and execute_write() to the MemgraphTransaction class.
  • Added a new GQLAlchemyTransientError exception class to show when errors from Memgraph indicate that a retry should be attempted.
  • Added a how-to guide for using the new features with HA.

Pull request type

Please delete options that are not relevant.

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring with functional or API changes
  • Refactoring without functional or API changes
  • Build or packaging related changes
  • Documentation content changes
  • Other (please describe):

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

######################################

Reviewer checklist (the reviewer checks this part)

  • Core feature implementation
  • Tests
  • Code documentation
  • Documentation on gqlalchemy/docs

######################################

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Expose client-side Bolt routing support (for Memgraph HA) through GQLAlchemy’s connection/vendor layers, and add CI + tests to validate routed read/write behavior.

Changes:

  • Add routing-capable connection creation (routing, access_mode, resolver) to MemgraphConnection and plumb it through the Memgraph vendor client.
  • Introduce a GQLAlchemyTransientError and map mgclient.TransientError via database_error_handler.
  • Add HA routing integration tests plus a Docker-based HA cluster bootstrap script and CI workflow step.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
gqlalchemy/connection.py Adds routing/access-mode/resolver plumbing into mgclient.connect(...) creation.
gqlalchemy/vendors/memgraph.py Passes routing parameters from Memgraph client into MemgraphConnection.
gqlalchemy/exceptions.py Adds GQLAlchemyTransientError and maps transient driver errors in the decorator.
gqlalchemy/__init__.py Exposes new exception types at the package top-level.
tests/test_exceptions.py Adds unit tests for transient vs non-transient error mapping behavior.
tests/integration/test_routing.py Adds integration tests validating routed READ/WRITE connections against an HA cluster.
scripts/ha_cluster.sh Adds a helper script to start/stop a local Memgraph HA cluster in Docker for tests/CI.
pytest.ini Registers a routing marker for HA-dependent tests.
pyproject.toml Temporarily points pymgclient to a git branch via uv sources to develop/test routing.
.github/workflows/build-and-test.yml Starts/stops the HA cluster in CI (when license secrets exist) to run routing tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gqlalchemy/exceptions.py
Comment thread pyproject.toml Outdated
Comment thread tests/test_exceptions.py
@mattkjames7
mattkjames7 marked this pull request as ready for review July 20, 2026 13:58
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Comment thread docs/how-to-guides/high-availability.md Outdated
Comment thread docs/reference/gqlalchemy/vendors/memgraph.md
Comment thread docs/reference/gqlalchemy/connection.md
@mattkjames7 mattkjames7 modified the milestone: GQLAlchemy 1.9.0 Jul 22, 2026
@mattkjames7
mattkjames7 merged commit 6fb9b1b into main Jul 22, 2026
12 checks passed
@mattkjames7 mattkjames7 added this to the GQLAlchemy 1.10.0 milestone Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs needed Docs needed feature feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants